package com.tepth.busfix.main.chooseoperator;

import com.tepth.busfix.bean.reponse.TroubleClassification;
import com.tepth.busfix.network.ApiModel;
import com.tepth.busfix.network.observer.SimpleDisposableObserver;

import java.util.List;

/**
 * Created by TMVPHelper on 2017/03/16
 */
public class ChooseOperatorPresenter extends ChooseOperatorContract.Presenter {

    @Override
    public void getTroubleClassification() {
        mRxManager.add(mModel.getTroubleClassification(mView.getAuthKey())
                .subscribeWith(new SimpleDisposableObserver<ApiModel<List<TroubleClassification>>>(mView) {

                    @Override
                    public void onSucceed(Object o) {
                        List<TroubleClassification> list = (List<TroubleClassification>) o;
                        mView.setTroubleClassifications(list);
                    }
                }));
    }
}